package com.aegean.MonitorExamSYS.conduction.action;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.interceptor.RequestAware;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.aegean.MonitorExamSYS.conduction.business.ConductionBusiness;
import com.aegean.MonitorExamSYS.conduction.component.PositionsInfo;
import com.aegean.MonitorExaxSYS.model.ConductionValue;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

@Controller("SearchExamInfomation")
@Scope("prototype")
public class SearchExamInfomation extends ActionSupport implements ServletRequestAware {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8307076006854764693L;
	@Resource
	ConductionBusiness business;
	private int total;
	private int small_Id;
	private HttpSession session;
	private ConductionValue conduction;
	private List<PositionsInfo> positions;
	public int getSmall_Id() {
		return small_Id;
	}
	public void setSmall_Id(int small_Id) {
		this.small_Id = small_Id;
	}public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	public List<PositionsInfo> getPositions() {
		return positions;
	}

	public void setPositions(List<PositionsInfo> positions) {
		this.positions = positions;
	}

	public String Positions() throws Exception {
		// TODO Auto-generated method stub
		conduction = (ConductionValue) session.getAttribute("ConductionLogin");
		conduction.getConduction_Id();
		positions = business.showPositions(small_Id,
				conduction.getConduction_Id());
		total=positions.size();
		return SUCCESS;
	}
	@Override
	public void setServletRequest(HttpServletRequest arg0) {
		// TODO Auto-generated method stub
		session=arg0.getSession();
		
	}

}
